<?php
class Kalender extends Base_model
{
	function __construct()
	{	
		parent::__construct();
		$this->init("kalender","id_kalender","tgl");				
	}
	
	function get_jenis($tgl)
	{
		$rec = $this->db->select("jenis_hari")->from($this->table_name)->where("tgl",$tgl)->get();
		if($rec->num_rows()>0)
		{
			$row = $rec->row();
			return $row->jenis_hari;
		}
		return FALSE;
	}
	
	function get_data($year,$mon)
	{
		$sql="select * from kalender where month(tgl)=$mon and year(tgl)=$year order by tgl";
		$rec = $this->db->query($sql);
		if($rec->num_rows()>0)
		{
			$result = $rec->result();
			return $result;
		}
		return FALSE;
		
	}
}
?>